package com.voice.core.connection.callback;

import com.voice.core.entity.HttpHeader;
import com.voice.core.connection.Connection;
import com.voice.core.connection.entity.Stream;

import java.io.IOException;

public interface StreamListener<T extends Connection> {

    void onDataRead(T connection, Stream stream, byte[] bytes, boolean endOfStream);

    void onStreamRead(T connection,byte[] bytes);

    void onHeadersRead(T connection, Stream stream, HttpHeader requestHeader, boolean endOfStream);

    void onStreamError(T connection, Stream stream, IOException exception);
}
